package oop;

import java.util.Scanner;

/**
 * @ClassName : oop.Demo02
 * @Author : LV88VL
 * @Date: 2021/2/2 17:25
 * @Description : 数据流程控制
 */
public  class Demo02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i=0;
        float f=0.0f;
        System.out.println("请输入整数");
        if (scanner.hasNextInt()){
            i = scanner.nextInt();
            System.out.println("整数数据" + i);
        }else{
            System.out.println("输入的不是整数数据");
        }


        System.out.println("请输入整数");
        if (scanner.hasNextFloat()){
            f = scanner.nextFloat();
            System.out.println("整数数据" + f);
        }else{
            System.out.println("输入的不是整数数据");
        }

        scanner.close();
    }
}
